package com.wufeng.springcloud.controller;

import com.wufeng.springcloud.entities.CommonResult;
import com.wufeng.springcloud.entities.Payment;
import com.wufeng.springcloud.service.PaymentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class FeignConsumerController {
    @Resource
    private PaymentService paymentService;


    @PostMapping(value = "/consumer/payment/create")
    public CommonResult add(@RequestBody Payment payMent){
        return paymentService.add(payMent);
    }

    @GetMapping(value = "/consumer/payment/list/{id}")
    public CommonResult list(@PathVariable("id") Long id){
        return paymentService.list(id);
    }

    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeOut(){
        return paymentService.paymentFeignTimeOut();
    }
}
